package com.farecrawler.junit;

import junit.framework.TestCase;
import junitx.util.PrivateAccessor;

public class FareCrawlTestCase extends TestCase {
	
	private Object testObject;

	/**
	 * Wrapper for PrivateAccessor.invoke();
	 * 
	 * @param methodName
	 * @param argClassType
	 * @param args
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	protected Object invokePrivate(String methodName, Class[] argClassType,
			Object[] args) {

		Object obj = null;
		try {
			obj = PrivateAccessor.invoke(this.testObject, methodName, argClassType,
					args);
		} catch (Throwable e) {
			e.printStackTrace();
			fail("PrivateAccessor invoke failed.");
		}
		return obj;
	}

	/*
	 * Getters Setters
	 */
	public Object getTestObject() {
		return testObject;
	}

	public void setTestObject(Object testObject) {
		this.testObject = testObject;
	}

}
